import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import path from "path";
import WindiCSS from "vite-plugin-windicss";

export default defineConfig({
  resolve: {
    // 配置别名
    alias: {
      "@": path.resolve(__dirname, "./src"),
    },
  },
  server: {
    hmr: true,
    usePolling: true,
    'proxy': {
      "/api": {
        target: "http://ceshi13.dishait.cn/admin/",
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, ""),
      },
    },
    host: true,
  },
  plugins: [vue(), WindiCSS()],
});
